<template>
  <div>
    <h3>Switch组件的使用</h3>
    <el-switch v-model="value"></el-switch>

    <h4>switch组件的各种属性使用</h4>
    <el-switch v-model="value" :active-value="true" :inactive-value="false" active-text="打开" inactive-text="关闭"></el-switch>

    <h4>switch组件的事件的使用</h4>
    <el-switch v-model="value" :active-value="true" :inactive-value="false" active-text="打开" inactive-text="关闭" @change="printVal"></el-switch>

  </div>
</template>
<script>
  export default {
    data() {
      return {
        value: true,

      };
    },
    methods:{
      printVal(val) {
        console.log(val);
      },
    }
  }
</script>
<style scoped>

</style>
